#encoding=utf-8


from pagelinks import PageLinks
import urllib
import BeautifulSoup



import sys
import re


#fp = urllib.urlopen('http://library.suda.edu.cn/')
#s = fp.read()
#
#print s.decode('gbk')
#soup = BeautifulSoup.BeautifulSoup(s)
#print soup

pl = PageLinks('http://library.suda.edu.cn/').get_html_links()
print pl
for _ in pl:
    print _


#ptn = re.compile(r'charset=(.*)\"')
#m = ptn.search('')

#    
#    
#import re
#def url_encode(_url):
#    
#    ptn = re.compile(r'([^\x00-\x7f]+)')
#    arr = ptn.split(_url)
#    
#    sss = ''
#    for s in arr:
#        if ptn.match(s):
#            sss += urllib.quote(s)
#        else: sss += s
#    
#    return sss
#
#print url_encode('http://www.g.cn/admin/index.html?a=123a中国bc234中国444中国666')


